﻿#ifndef __AVOID_BW_CONTROL_SLIDER_HEAD_FILE_INCXLUDED__
#define __AVOID_BW_CONTROL_SLIDER_HEAD_FILE_INCXLUDED__
#include "control.h"
#include "ctlButton.h"
#include "ctlProgress.h"

namespace swui
{
#pragma warning(push)
#pragma warning(disable:4250)
	class ctlSlider : public ctlProgress
	{
	public:
		static const ctlControlType uniqueType = ctlControlType::ctlSlider;
	public:
		virtual ~ctlSlider() { destroy(); }
		//建议高（宽）度：btnSize / 2 - 1
		bool create(ctlRoot* parent, ctlRect rect, unsigned btnSize = 14,
			ctlScrollDirection direction = ctlScrollDirection::horizontal,
			const ctlStyleProgress& = ctlStyleProgress(ctlStyleProgress::common));
	public:
		virtual bool setZOrder(unsigned);
		virtual bool setLogicProgress(int logicProgress);
		//获取按钮
		ctlButton* getButton();
		//这个矩形将是包括按钮在两个边界时的矩形
		ctlRect getVirtualRect();
	protected:
		virtual void _position_event_(ctlPositionEvent* pe);
		virtual void _mouse_event_(ctlMouseEvent* me);
	private:
		ctlButton _slider_button;
	};
#pragma warning(pop)
}

#endif